package com.qzboot.backend.web.module.sys.controller;

import com.qzboot.backend.web.module.sys.BaseSysController;
import com.qzboot.common.support.WebResult;
import com.qzboot.facade.service.SysMenuService;
import com.qzboot.facade.service.SysRoleMenuService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zengzhihong
 * @date 2019-12-17
 */
@RestController
@RequestMapping("/sysRoleMenu")
public class SysRoleMenuController extends BaseSysController {

    @Reference
    private SysRoleMenuService sysRoleMenuService;

    @Reference
    private SysMenuService sysMenuService;



    /**
     * 通过角色ID查询菜单权限
     *
     * @param roleId
     * @return
     */
    @GetMapping("/listMenuIdByRoleId")
    public WebResult listMenuIdByRoleId(Long roleId) {
        //return WebResult.success(sysRoleMenuService.listMenuIdByRoleId(roleId));
        return WebResult.success(sysMenuService.listMenuIdByRoleId(roleId));
    }
}
